package com.clwl.supervise.superviseapp.mapper.risk;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clwl.supervise.superviseapp.entity.base.CommonSearchEntity;
import com.clwl.supervise.superviseapp.entity.risk.JgStaticScoring;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

@Mapper
public interface JgStaticScoringMapper extends BaseMapper<JgStaticScoring> {

    /**
     * 获取企业风险评定列表
     * @param params
     * @return
     */
    Long selectCompanyCount(@Param("params") CommonSearchEntity params);

    /**
     * 获取企业风险评定列表
     * @param iPage
     * @param params
     * @return
     */
    IPage<Map<String, Object>> selectCompanyList(IPage<Map<String, Object>> iPage,@Param("params") CommonSearchEntity params);

    /**
     * 获取企业平分信息
     * @param companyId 企业id
     * @param year 传null默认当年
     * @param deleteFlag 传null 默认!=1
     * @return
     */
    JgStaticScoring selectByCompanyId(@Param("companyId") Long companyId,@Param("year") String year ,@Param("deleteFlag") String deleteFlag);

    /**
     * 获取企业平分信息
     * @param companyId 企业id
     * @param year 传null默认当年
     * @param deleteFlag 传null 默认!=1
     * @return
     */
    JgStaticScoring selectByCompanyIdAndYearAll(@Param("companyId") Long companyId,@Param("year") String year);

    /**
     * 查询沿用上一年静态评列表
     * @param id 住一间id
     * @param year 年
     * @return 对象
     */
    JgStaticScoring queryStaticScoring(@Param("id") Long id,@Param("year") String year);

    JgStaticScoring selectTempByCompanyIdAndYearAll(@Param("companyId") Long companyId,@Param("year") String year);


}